package com.twu.biblioteca;

import org.w3c.dom.Document;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.File;

public class FileHandler {

    private static boolean SUCCESS = true;
    private static boolean ERROR = false;

    public FileHandler(){}

    public Document loadFile(String filePath) {
        try{
            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();

            Document fileDocument = docBuilder.parse (new File(filePath));
            fileDocument.getDocumentElement ().normalize ();
            return fileDocument;
        }catch (Exception err) {
            return null;
        }
    }




}
